export default {
  data () {
    return {
      theadArr: [
        'selection',
        'enjoy_date',
        'name',
        'identityCardNO',
        'sex',
        'age',
        'edu',
        'address',
        'work_year',
        'work_experience',
        'apply_time',
        'dispatch_order',
        'accept_order',
        'finish_order',
        'fail_order',
        'ongoing_order',
        'income',
        'feedback',
        'status'
      ]
    }
  },
  methods: {
    // 设置表头
    getTableColumns (arr) {
      const tableColumns = {
        selection: {
          type: 'selection',
          width: 60,
          fixed: 'left'
        },
        enjoy_date: {
          title: '入驻日期',
          minWidth: 150,
          key: 'enjoy_date'
        },
        name: {
          title: '姓名',
          minWidth: 90,
          key: 'name'
        },
        identityCardNO: {
          title: '身份证号码',
          minWidth: 170,
          key: 'identityCardNO'
        },
        sex: {
          title: '性别',
          minWidth: 80,
          key: 'sex'
        },
        age: {
          title: '年龄',
          minWidth: 80,
          key: 'age'
        },
        edu: {
          title: '学历',
          minWidth: 80,
          key: 'edu'
        },
        address: {
          title: '居住地',
          minWidth: 150,
          key: 'address'
        },
        work_year: {
          title: '工作经验',
          minWidth: 110,
          key: 'work_year'
        },
        work_experience: {
          title: '工作经历',
          minWidth: 150,
          key: 'work_experience'
        },
        apply_time: {
          title: '申请时间',
          minWidth: 100,
          key: 'apply_time'
        },
        dispatch_order: {
          title: '用户账号',
          minWidth: 80,
          key: 'dispatch_order'
        },
        accept_order: {
          title: '账号密码',
          minWidth: 80,
          key: 'accept_order'
        },
        finish_order: {
          title: '管理员姓名',
          minWidth: 80,
          key: 'finish_order'
        },
        fail_order: {
          title: '管理员账号',
          minWidth: 80,
          key: 'fail_order'
        },
        ongoing_order: {
          title: '管理员密码',
          minWidth: 80,
          key: 'ongoing_order'
        },
        income: {
          title: '管理企业',
          minWidth: 80,
          key: 'income'
        },
        feedback: {
          title: '客户评价',
          minWidth: 180,
          slot: 'feedback'
        },
        status: {
          title: '管理子企业',
          minWidth: 160,
          key: 'status'
        }
      }
      let data = []

      arr.forEach(col => data.push(tableColumns[col]))

      return data
    }
  }
}
